#ifndef __DECORATOR_H__
#define __DECORATOR_H__

#include <iostream>
#include <string>

class IComponent
{
public:
    IComponent() = default;
    ~IComponent() = default;

    virtual void Action() = 0;
};

class Person:public IComponent
{
public:
    Person(std::string name)
    {
        name_ = name;
        std::cout << name_ << ":" << std::endl;
    }
    ~Person() = default;

    void Action();
private:
    std::string name_;
};

class Finery:public IComponent
{
public:
    Finery(IComponent *component)
    {
        component_ = component;
    }
    ~Finery() = default;

protected:
    void Action()
    {
        if (component_)
        {
            component_->Action();
        }
    }

private:
    IComponent *component_;
};

class BigTrouse:public Finery
{
public:
    BigTrouse(IComponent *decorator) : Finery(decorator){}
    ~BigTrouse() = default;

    void Action();

private:
    IComponent *decorator_;
    void MySelf();
};

class Tshirts:public Finery
{
public:
    Tshirts(IComponent *decorator) : Finery(decorator){}
    ~Tshirts() = default;

    void Action();
};

#endif

